package top.saodisheng.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Description:
 *
 * @author 扫地生_saodisheng
 */
public class DateUtil {
    public static Date nextSevenDate() {
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(new Date());
//        System.out.println(cal.getTime());
        cal.add(Calendar.DATE, 7);
//        System.out.println(cal.getTime());
        return cal.getTime();
    }

    public static Date formatDate(String date){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date result = null;
        try {
            result = sdf.parse(date + " 00:00:00");
        } catch (ParseException e) {
            e.printStackTrace();
        } finally {
            return result;
        }
    }
}
